package com.zyb.beidada.config;

import com.zhipu.oapi.ClientV4;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

/**
 * @author 十八岁讨厌编程
 * @date 2025/5/7 18:04
 * @PROJECT_NAME beidada-backend
 * @description 将智普AI客户端纳入spring管理
 */

@Configuration
public class AIConfig {

    @Value("${ai.apikey}")
    private String AI_KEY;


    @Bean
    public ClientV4 getClientV4(){
        return new ClientV4.Builder(AI_KEY).
                networkConfig(1,1,1,1, TimeUnit.MINUTES)
                .build();
    }
}
